- /* slmrwput.cpp by K.Tsuru */
- // function ID = 217 DRADIX, BRADIX
- /***************************
- SLong and SInteger classes
- output in raw representation
- ****************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- long SLong::RawPut(int crlf) const{
- long cCount = 0;
- int p = (int)(Size()-1);
- int nc = 0; //the number of digits and delimters per line
- const int width = (Radix() == DRADIX) ? DFIGURES : BFIGURES;
- int nl = displayWidth/(width+1); //the number per line
- FILE* out = FileStream();
-
- //output negative sign
- if(RawSign() == -1 ){ putc('-', out); cCount++; }
- else if(RawSign() == -1 ){
- putc('*', out); cCount++;
- if(Size()==0) return cCount;
- }
-
- for( ; p >= 0; p--){
- // cCount += fprintf(out, "%0*"fTypeFormat, width, figure(p));
- cCount += fprintf(out, "%0*" fTypeFormat, width, figure(p)); // for c++11
- nc++;
- if(nc == nl){ putc('\n', out); nc = 0;
- } else putc(' ', out);
- cCount++;
- }
- char buff[100];
- sprintf(buff, "(size = %u, head = %u, tail = %u)", Size(), aHead, aTail);
- if( displayWidth - nc*(width+1) < strlen(buff) ){
- putc('\n', out); cCount++;
- }
- cCount += fprintf(out, "%s", buff);
- if(crlf){ putc('\n', out); cCount++; }
- return cCount;
- }
slmrwput.cpp : last modifiled at 2017/07/17 15:28:16(1,246 bytes)
created at 2017/10/07 10:26:48
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).